package eirkdbd.lab1.membership.functions;

import eirkdbd.lab1.data.Team;
import eirkdbd.lab1.membership.MembershipFunction;
import eirkdbd.lab1.membership.functions.helpers.LinearMembershipFunction;

/**
 * NotGoalloosing is team skill not to loose goals
 *
 */
class NotGoalloosing implements MembershipFunction {

	private final double maxX = 17;
	private final double minX = 30;
	private LinearMembershipFunction lmf;
	
	public NotGoalloosing() {
		lmf = new LinearMembershipFunction(minX, maxX);
	}	
	
	/**
	 * Returns degree of membership to NotGoalloosing team group
	 */
	public double getValue(Team team) {
		return lmf.value(team.getPenalty());
	}
}
